package com.knife.oauth.domain.entity;

import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.userdetails.User;

import java.io.Serializable;
import java.util.Collection;
import java.util.List;

/**
 * @author HQK
 */
public class KnifeUserDetails extends User implements Serializable {
    private static final long serialVersionUID = -3762281463683847665L;
    /**
     * 用户主键
     *
     * @description
     * @version 1.0
     * @author tianhao.luo@hand-china.com
     * @date 2022/2/27 11:00 上午
     * @since 1.0
     */
    private Long userId;

    /**
     * 实际名称
     *
     * @description
     * @version 1.0
     * @author tianhao.luo@hand-china.com
     * @date 2022/2/27 11:00 上午
     * @since 1.0
     */
    private String realName;

    /**
     * 邮箱
     *
     * @description
     * @version 1.0
     * @author tianhao.luo@hand-china.com
     * @date 2022/2/27 11:00 上午
     * @since 1.0
     */
    private String email;

    /**
     * 所在时区
     *
     * @description
     * @version 1.0
     * @author tianhao.luo@hand-china.com
     * @date 2022/2/27 11:00 上午
     * @since 1.0
     */
    private String timeZone;

    /**
     * 语言
     *
     * @description
     * @version 1.0
     * @author tianhao.luo@hand-china.com
     * @date 2022/2/27 11:00 上午
     * @since 1.0
     */
    private String language;

    /**
     * roleId : 当前角色Id
     */
    private Long roleId;

    /**
     * roleIds : 当前可选角色ID
     */
    private List<Long> roleIds;

    /**
     * tenantId : 当前租户，如果和用户切换租户，该ID为切换租户后的租户ID
     */
    private Long tenantId;
    /**
     * tenantIds: 当前可选租户
     */
    private List<Long> tenantIds;

    /**
     * 用户头像
     */
    private String imageUrl;

    /**
     * 用户所属租户，不会随着用户选择的租户变化
     */
    private Long organizationId;

    /**
     * 是否管理员标记
     *
     * @description
     * @version 1.0
     * @author tianhao.luo@hand-china.com
     * @date 2022/2/27 11:00 上午
     * @since 1.0
     */
    private Boolean isAdmin;

    public KnifeUserDetails(String username, String password, Collection<? extends GrantedAuthority> authorities) {
        super(username, password, authorities);
    }

    public String getLanguage() {
        return language;
    }

    public void setLanguage(String language) {
        this.language = language;
    }


    public Long getRoleId() {
        return roleId;
    }

    public void setRoleId(Long roleId) {
        this.roleId = roleId;
    }

    public List<Long> getRoleIds() {
        return roleIds;
    }

    public void setRoleIds(List<Long> roleIds) {
        this.roleIds = roleIds;
    }

    public Long getTenantId() {
        return tenantId;
    }

    public KnifeUserDetails setTenantId(Long tenantId) {
        this.tenantId = tenantId;
        return this;
    }


    public List<Long> getTenantIds() {
        return tenantIds;
    }

    public KnifeUserDetails setTenantIds(List<Long> tenantIds) {
        this.tenantIds = tenantIds;
        return this;
    }

    public String getImageUrl() {
        return imageUrl;
    }

    public KnifeUserDetails setImageUrl(String imageUrl) {
        this.imageUrl = imageUrl;
        return this;
    }

    public Long getUserId() {
        return userId;
    }

    public void setUserId(Long userId) {
        this.userId = userId;
    }

    public String getRealName() {
        return realName;
    }

    public KnifeUserDetails setRealName(String realName) {
        this.realName = realName;
        return this;
    }

    public Long getOrganizationId() {
        return organizationId;
    }

    public void setOrganizationId(Long organizationId) {
        this.organizationId = organizationId;
    }

    public String getTimeZone() {
        return timeZone;
    }

    public void setTimeZone(String timeZone) {
        this.timeZone = timeZone;
    }


    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    public Boolean getAdmin() {
        return isAdmin;
    }

    public void setAdmin(Boolean admin) {
        isAdmin = admin;
    }



}
